<html>
<head>
    <meta charset="UTF-8">
    <title>合同日计划</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="stylesheet" href="../../layui/css/layui.css"/>
    <link rel="stylesheet" href="../../css/bass.css"/>
    <link rel="stylesheet" href="../../css/air/arrPay.css"/>
</head>

<body>
<div class="body contractDay">
    <header class="layui-nav" id="headerTop"></header>
    <div class="left_muen" id="left_menu"></div>
    <div class="content_body contractDay">
        <p class="content_title">气量管理&nbsp;&nbsp;>&nbsp;&nbsp;当日燃气价格</p>
        <div class="content_seach">
            <div class="layui-form">
                <div class="layui-inline">
                    <label class="layui-form-label">日期</label>

                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" lay-verify="date" name="startTime" id="test31" placeholder="请输入起始日期">
                    </div>
                    <div class="layui-input-inline">
                        <input type="text" class="layui-input" lay-verify="date" name="endTime" id="test32" placeholder="请输入结束日期">
                    </div>
                </div>
                <div class="layui-btn layui-btn-warm search layui-btn-sm" id="search" lay-submit="" lay-filter="search">
                    <i class="layui-icon">&#xe615;</i>查询
                </div>
            </div>
        </div>
        <div class="content_table">
            <script type="text/html" id="toolbarDemo">
                <div class="layui-btn-container">
                    <button class="layui-btn layui-btn-sm" lay-event="addCheckData"><i class="layui-icon">&#xe654;</i>添加</button>
                    <button class="layui-btn layui-btn-sm" lay-event="imgCheckData"><i class="layui-icon">&#xe62c;</i>趋势图</button>
                </div>
            </script>
            <div class="tabTable">
                <table id="demo"  lay-filter="tableFilter" lay-data="{id:'idTest'}"></table>
                <div class="layui-table-page fr">
                    <div id="layui-table-page1"></div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="maTypeTemplet">
    {{#if (d.dataStatus == 0) { }}
    待发布
    {{# }else if(d.dataStatus == 1){ }}
    已确认
    {{# }else if(d.dataStatus == 1){ }}
    已发布
    {{# } }}
</script>
<script src="../../js/common/jquery-1.11.3.min.js"></script>
<script src="../../layui/layui.js"></script>
<script src="../../js/common/navList.js"></script>
<script src="../../js/common/ajax.js"></script>

<script>
    layui.use(['table','form','laydate'], function () {
        var form = layui.form;
        var laydate = layui.laydate;
        laydate.render({
            elem: '#test31',
            theme: 'grid',
        });
        laydate.render({
            elem: '#test32',
            theme: 'grid',
        });
    });
    layui.use(['table','form'], function () {
        var form = layui.form;
        //初始化第一个实例
        ajaxTable({
            idNode: '#demo',
            url: 'daygasprice/getList',
            dataCols: [
//              {fixed: true, checkbox: true},
                {field: 'date', title: '日期',align: 'center',sort: true},
                {field: 'price', title: '价格',align: 'center',sort: true},
                {field: 'unit', title: '单位',align: 'center'},
                {field: 'unit', title: '天气情况',align: 'center'}
            ],
            successFull:function(res, curr, count,table){
                table.on('toolbar(tableFilter)', function(obj) {
                    var checkStatus = table.checkStatus(obj.config.id);
                    if(obj.event == 'addCheckData'){
                        window.location.href = './arrPayAdd.html?pos=4&childPos=0';
                    };
                    if(obj.event == 'imgCheckData'){

                    }
                });
            }
        });
//        条件查询
        form.on('submit(search)', function(data){
            ajaxTable({
                idNode: '#demo',
                url: 'daygasprice/getList',
                urlParme:'&startTime='+data.field.startTime+'&endTime='+data.field.endTime,
                dataCols: [
                    {fixed: true, checkbox: true},
                    {field: 'date', title: '日期',align: 'center',sort: true},
                	{field: 'price', title: '价格',align: 'center',sort: true},
                	{field: 'unit', title: '单位',align: 'center'}
//                    {field: 'right', title: '操作', width: 170, toolbar: "#barContractUpdate"}
                ],
                successFull: function (res, curr, count) {
                }
            });
        })
    });
</script>
</body>
</html>